package component.global.manager
{
	import flash.system.System;
	import flash.text.TextField;
	import flash.utils.getTimer;

	public class DebuggerManager
	{
		public function DebuggerManager()
		{
		}
		
		private static var _instance:DebuggerManager;
		
		public static function get Instance():DebuggerManager{
			if(_instance == null){
				_instance = new DebuggerManager();
			}
			return _instance;
		}
		
		private var _text:TextField;
		
		public function initialization():void{
			_text = new TextField();
			_text.y = 450;
			_text.width = 400;
			_text.height = 190;
			_text.textColor = 0xCCCCCC;
			_text.multiline = _text.wordWrap = true;
			LayerManager.Instance.debugLayer.addChild(_text);
		}
		
		public function traceS(...args):void{
			if(_text == null)return;
			for (var i:int = 0; i < args.length; i++) 
			{
				_text.text = _text.text + args[i] + " ";
			}
			
//			var memory:Number = System.totalMemoryNumber/(1024 * 1024);
//			_text.text = _text.text + " memory:" + memory.toString() + "\n";
			_text.appendText("\n");
			_text.scrollV = _text.maxScrollV;
		}
	}
}